package org.android.tools;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;

public class UserPermision implements KvmSerializable{
	
	public Integer iduserPermision;
	public String name;
	
	public UserPermision() {
    }

	
    public UserPermision(String name) {
        this.name = name;
    }
    
    public Object getProperty(int arg0) {
		// TODO Auto-generated method stub
		switch(arg0) {
		case 0:
			return iduserPermision;
		case 1:
			return name;
		}
		return null;
	}

	public int getPropertyCount() {
		// TODO Auto-generated method stub
		return 2;
	}

	public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
		// TODO Auto-generated method stub
		switch(arg0)
        {
        case 0:
        	arg2.type = PropertyInfo.INTEGER_CLASS;
        	arg2.name = "iduserPermision";
        	break;
        case 1:
        	arg2.type = PropertyInfo.STRING_CLASS;
        	arg2.name = "name";
            break;
        default:break;
        }
	}

	public void setProperty(int arg0, Object arg1) {
		// TODO Auto-generated method stub
		switch(arg0)
        {
        case 0:
            iduserPermision = Integer.parseInt(arg1.toString());
            break;
        case 1:
            name = arg1.toString();
            break;
        default:
            break;
        }
	}
	
	public static UserPermision parseUserPermision(SoapObject soap, int arg0)
	{
		SoapObject arg1 = (SoapObject) soap.getProperty(arg0);
		UserPermision userPermision = new UserPermision();
		userPermision.iduserPermision = Integer.parseInt(arg1.getProperty(0).toString());
		userPermision.name = arg1.getProperty(1).toString();
		return userPermision;
	}
	
}
